import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
import tabBar from '@/untils/tabbar.js'
const store = new Vuex.Store({
	state: {
		wx_token: '',
		tabBarList: [],
		permission: 0,
	},
	getters: {
	tabBarList(state) {
      return state.tabBarList
    },
	},
	mutations: {

		setWxtoken(state, data) {
			state.wx_token = data;
			uni.setStorageSync('wx_token',data)
		},

		setRoleId(state, data) {
			state.permission = data;
			uni.setStorageSync('permission',data)
			state.tabBarList = tabBar[data];
			uni.setStorageSync('tabBarList',tabBar[data])
		},
	},
})
export default store